﻿using Jacobi.Vst.Core;
using Jacobi.Vst.Core.Host;
using Jacobi.Vst.Interop.Host;
using Play.VstPluginManagement;

namespace Play.TrackManagement
{
	public class TrackFactory
	{
		private readonly VstPluginFactory _vstPluginFactory;

		public TrackFactory(VstPluginFactory vstPluginFactory)
		{
			_vstPluginFactory = vstPluginFactory;
		}

		public Track CreateTrackFromPluginInfo(VstPluginInfo vstPluginInfo)
		{
			var vstPluginContext = _vstPluginFactory.Create(vstPluginInfo);
			return new Track(vstPluginContext);
		}
	}
}
